<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');
$this->load->helper('url');
?><!DOCTYPE html>
	<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title><?php echo $sys['title'];?></title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="<?php echo $sys['description'];?>" />
	<meta name="keywords" content="<?php echo $sys['keyword'];?>" />
 	<link rel="shortcut icon" href="favicon.ico">
	<link rel="stylesheet" href="/static/css/animate.css">
	<link rel="stylesheet" href="/static/plugin/jquery-ui/jquery-ui.min.css" />
	<link rel="stylesheet" href="/static/plugin/font-awesome/css/font-awesome.min.css" />
	<link rel="stylesheet" href="/static/css/style.css" id="css_style">
	<link rel="stylesheet" href="/uploadify/uploadify.css" />
	
	<script src="/static/js/jquery-1.10.2.min.js"></script>
	<script src="/static/js/jquery.cookie.js"></script>
	<script src="/static/plugin/jquery-ui/jquery-ui.min.js"></script>
	<script src="/static/plugin/layer/layer.js"></script>
	<script src="/static/js/jquery.form.min.js"></script>
	<script src="/uploadify/jquery.uploadify.min.js"></script>
	<script src="/static/js/extend.js"></script>
	
	<script type="text/javascript">
	$(function(){
		var _w = $(window).width();
		if(_w < 600) {
			$('#css_style').attr('href','/static/css/m_style.css');
		}
	});
	</script>
	</head>
	
	<body>
		<div class="header-box">
			<div class="header">
				<div class="header-bg"></div>
				<div class="container">
					<h1><a href="<?php echo site_url('home');?>"><img src="/upload/system/<?php echo $sys['logo'];?>"></a></h1>
					<div class="nav">
						<ul>
							<li><a class="
<?php
if ($ctl == '') {
?>on<?php
}

?>" href="<?php echo site_url('home');?>"><?php echo lang('header_home');?></a></li> 
							<li><a class="
<?php
if ($ctl == 'items') {
?>on<?php
}

?>" href="<?php echo site_url('items');?>">浏览项目</a></li>
							<li><a class="
<?php
if ($ctl == 'item_add') {
?>on<?php
}

?>" href="<?php echo site_url('item_add');?>">发起项目<span>+</span></a></li>
							<li><a class="
<?php
if ($ctl == 'push') {
?>on<?php
}

?>" href="<?php echo site_url('push');?>">PUSH集市</a></li>
							<li><a href="<?php echo site_url('article');?>">站内公告</a></li>
							<li style="display:none;" class="nav-item">
								<a class="nav-btn" href="#">
<?php
if ($lang == 'en') {
?><img src="/static/images/en.png"><?php
}
else {
?><img src="/static/images/cn.png"><?php
}

?><i class="fa fa-caret-down"></i></a>
								<ul class="menu-lang-box">
									<li><i class="fa fa-caret-up"></i></li>
								 	<li class="menu-lang"><a data-lang="en" href="#"><img src="/static/images/en.png"></a></li>
									<li class="menu-lang"><a data-lang="cn" href="#"><img src="/static/images/cn.png"></a></li>
								</ul>
								<script type="text/javascript">
								$(function(){
									$('[data-lang]').click(function(){
										var lang = $(this).attr('data-lang');
										$.cookie('lang',lang);
										location.reload();
									});
								});
								</script>
							</li>
						</ul>
						<div class="clear"></div>
					</div>
					<div class="action">
						
<?php
if (intval($user['id']) <= 0) {
?>						<a class="action-btn login-btn" href="<?php echo site_url('user/login');?>"><i class="fa fa-user-o"></i>登录</a>
						<a class="action-btn reg-btn" href="<?php echo site_url('user/reg');?>">注册</a>
						<?php
}
else {
?>						<div class="header-user">
							<a class="action-btn login-btn" href="<?php echo site_url('account/index');?>"><i class="fa fa-user-o"></i><?php echo $user['username'];?></a>
							<div class="header-user-menu">
							<a href="<?php echo site_url('user/log_out');?>"><i class="fa fa-power-off"></i> 退出</a>
							</div>
						</div>
						<?php
}

?>						<div class="lang-box">
							<a class="lang-on" href="#">
<?php
if ($lang == 'en') {
?><img src="/static/images/en.png"><?php
}
else {
?><img src="/static/images/cn.png"><?php
}

?></a>
							<ul class="menu-lang-box">
							 	<li class="menu-lang"><a data-lang="en" href="#"><img src="/static/images/en.png"></a></li>
								<li class="menu-lang"><a data-lang="cn" href="#"><img src="/static/images/cn.png"></a></li>
							</ul>
							<script type="text/javascript">
							$(function(){
								$('[data-lang]').click(function(){
									var lang = $(this).attr('data-lang');
									$.cookie('lang',lang);
									location.reload();
								});
							});
							</script>
						</div>
					</div>
					<div class="clear"></div>
				</div>
			</div>
		</div>